import React, { Component } from 'react'
import News from './News/index'
import Message from './Message/index'
import MyNavLink from '../../components/MyNavLink'
import {Redirect,Route,Switch} from 'react-router-dom'

export default class Home extends Component {
  render() {
    return (
      <div>
        <h2>Home组件内容</h2>
        <div>
          <ul className="nav nav-tabs">
            <li>
              {/* <a className="list-group-item active" href="./home-news.html">News</a> */}
              <MyNavLink to="/home/news">News</MyNavLink>
            </li>
            <li>
              {/* <a className="list-group-item " href="./home-message.html">Message</a> */}
              <MyNavLink to="/home/message">Message</MyNavLink>
            </li>
          </ul>
          {/* news */}
          {/* <News></News>
          <Message></Message> */}
          <Switch>
            <Route path='/home/news' component={News}></Route>
            <Route path='/home/message' component={Message}></Route>
            <Redirect to="/home/news"></Redirect>
          </Switch>
        </div>
      </div>
    )
  }
}
